//
//  DetailesClass.m
//  YaoHeAPP
//
//  Created by mac on 15/12/17.
//  Copyright © 2015年 mac. All rights reserved.
//

#import "DetailesClass.h"

@implementation DetailesClass
-(id)initWithDic:(NSDictionary*)dic
{
    self=[super init];
    if (self) {
        self.send_conut=dic[@"SEND_COUNT"];
        self.quantity=dic[@"QUANTITY"];
        self.category_name=dic[@"CATEGORY_NAME"];
        self.is_nned_invoice=dic[@"IS_NNED_INVOICE"];
        self.status=[dic[@"STATUS"] integerValue];
        self.variety_name=dic[@"VARIETY_NAME"];
        self.tolerance=dic[@"TOLERANCE"];
        self.purchase_count=[NSString stringWithFormat:@"%@",dic[@"PURCHASE_COUNT"]];
        self.material_name=dic[@"MATERIAL_NAME"];
        self.variety_ID=dic[@"VARIETY_ID"];
        self.create_time=dic[@"CREATE_TIME"];
        self.manufacturer_name=dic[@"MANUFACTURER_NAME"];
        self.total_seconds=dic[@"TOTAL_SECONDS"];
        self.min_price=dic[@"MIN_PRICE"];
        self.last_operator_time=dic[@"LAST_OPERATOR_TIME"];
        self.img_pathsAry=dic[@"IMG_PATHS"];
        self.spec_code=dic[@"SPEC_CODE"];
        self.supply_cityID=dic[@"SUPPLY_CITY_ID"];
        self.quote_num=dic[@"QUOTE_NUM"];
        self.purchaseID=[dic[@"PURCHASE_ID"] integerValue];
        self.weight=dic[@"WEIGHT"];
        self.remark=dic[@"REMARK"];
        self.supply_provinceID=dic[@"SUPPLY_PROVINCE_ID"];
        self.quoteinfonsAry=dic[@"QUOTE_INFOS"];
        self.effective_hour=dic[@"EFFECTIVE_HOUR"];
        self.supface_name=dic[@"SURFACE_NAME"];
        self.pass_count=dic[@"PASS_COUNT"];
        self.effective_minute=dic[@"EFFECTIVE_MINUTE"];
        self.nationalStandard=[self withDic:dic Key:@"NATIONAL_STANDARD"];
        self.tradeMark=[self withDic:dic Key:@"TRADE_MARK"];
    }
    return self;
}
-(NSString*)withDic:(NSDictionary*)dic Key:(NSString*)key
{
    NSString*string;
    if ([[dic allKeys]containsObject:key]) {
        string=dic[key];
    }
    else{
       string=@"";
    }
    return string;
}

@end

@implementation Quoteinfons

-(id)initWithDic:(NSDictionary*)dict
{
    self=[super init];
    if (self)
    {
        self.last_operator_time=[dict[@"LAST_OPERATOR_TIME"]integerValue];
        self.quoteID=dict[@"QUOTE_ID"];
        self.mobile=dict[@"MOBILE"];
        self.company_name=dict[@"COMPANY_NAME"];
        self.remark=dict[@"REMARK"];
        self.is_add_black=[dict[@"IS_ADD_BLACK"]integerValue];
        self.quote_price=dict[@"QUOTE_PRICE"];
        self.companyID=dict[@"COMPANY_ID"];
        self.user_name=dict[@"USER_NAME"];
        self.score=dict[@"SCORE"];
        self.userID=dict[@"USER_ID"];
        self.is_push=[dict[@"IS_PUSH"]integerValue];
        self.logo_imgPath=dict[@"LOGO_IMG_PATH"];
        self.price_unit=dict[@"PRICE_UNIT"];
        self.status=[dict[@"STATUS"] integerValue];
        if ([[dict allKeys] containsObject:@"ORDER_ID"]) {
            self.orderID=dict[@"ORDER_ID"];
        }
    }
    return self;
    
}


@end







